Skip to main content

Import

Usage

Parameters

GetSingleTokenBalanceArgs

HooksOptions

Return Type

The hook returns a React Query result object with the following properties:

TokenBalance

The returned data contains token balance information:

Notes

This hook provides a convenient way to fetch token balances for specific accounts and contracts. Key features:
  • Native Token Support: Use ZERO_ADDRESS for native tokens (ETH, MATIC, etc.)
  • ERC20 Support: Works with any ERC20 token contract
  • NFT Support: Supports ERC721 and ERC1155 tokens with optional tokenId
  • Caching: Uses React Query for efficient caching and background updates
  • Error Handling: Provides error states for failed requests
  • Loading States: Includes loading indicators for better UX
The hook automatically handles different token types and provides a unified interface for accessing token balance information.